eventcontrollerkey: Update im focus when active window changes
authorMatthias Clasen <mclasen@redhat.com>
Thu, 30 Jul 2020 17:23:45 +0000 (13:23 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 30 Jul 2020 17:23:45 +0000 (13:23 -0400)
Use the new GTK_CROSSING_ACTIVE crossing events to update
the im context focus when the window becomes active or
inactive. IBus requires this, since it has only a single,
global focus location.

Fixes: #2390
gtk/gtkeventcontrollerkey.c

index e813654be8489f5e6a11973a73f5050079e90470..4d8774b4259adf91fccc15fbe1445f8743bf98da 100644 (file)
@@ -154,7 +154,8 @@ gtk_event_controller_key_handle_crossing (GtkEventController    *controller,
   gboolean start_crossing, end_crossing;
   gboolean is_focus;
 
-  if (crossing->type != GTK_CROSSING_FOCUS)
+  if (crossing->type != GTK_CROSSING_FOCUS &&
+      crossing->type != GTK_CROSSING_ACTIVE)
     return;
 
   start_crossing = crossing->direction == GTK_CROSSING_OUT &&